<script setup lang="ts">
import jizai from '@/assets/jizai.png'
import { ref } from 'vue';

// userid=localStorage.getItem('userid')
import { useUserStore } from '@/stores/user'

const user = useUserStore()
const userid = user.userid
import { useRouter } from 'vue-router';

const router = useRouter()
function logOutClick() {
     user.changeUserState({
          token: '',
          userid: '',
          isLogin: false
     })
     router.push('/')
}
</script>
<template>
     <section>

          <van-image :src="jizai" round style="width: 20%;"></van-image>
          <div class="userInfo">
               <span>用户名： {{ userid ? userid : '游客' }}</span>
               
          </div>
     </section>

</template>
<style lang="scss" scoped>
section {
     display: flex;
     flex-direction: row;

     box-sizing: border-box;

     .userInfo {
          display: flex;
          flex-direction: column;
          margin-left: 20px;
          box-sizing: border-box;
     }
}
</style>